#!/bin/bash

echo "正在启动智能客服系统..."
echo

echo "检查MySQL连接..."
mysql -h 127.0.0.1 -P 3306 -u root -p123456 -e "SELECT 1;" > /dev/null 2>&1
if [ $? -ne 0 ]; then
    echo "错误: 无法连接到MySQL数据库，请确保MySQL服务已启动"
    exit 1
fi
echo "✓ MySQL连接正常"

echo
echo "启动Django服务器..."
python manage.py runserver 0.0.0.0:8000